import { arrayToTree } from '../../../helper';
export default {
  type: 'input-tree',
  name: 'menuTree',
  searchable: true,
  hideRoot: false,
  rootLabel: ' 测试顶点',
  heightAuto: true,
  showIcon: false,
  source: {
    url: '/api/menu/getAllRoutes',
    adaptor(ret) {
      return arrayToTree(ret);
    },
  },
  labelField: 'title',
  valueField: 'id',
  itemActions: {
    type: 'dropdown-button',
    level: 'link',
    icon: 'fa fa-ellipsis-v',
    hideCaret: true,
    align: 'right',
    popOverContainer: () => document.body,
    buttons: [
      {
        type: 'button',
        label: '按钮1',
        disabled: true,
      },
      {
        type: 'button',
        label: '按钮2',
      },
      {
        type: 'button',
        label: '按钮3',
      },
    ],
  },
};
